package com.imooc.cloud.mall.practice.cartorder.config;

import com.imooc.cloud.mall.practice.categoryproduct.common.ProductConstant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName: ImoocMallWebMvcConfig
 * Package: com.imooc.cloud.mall.practice.cartorder.config
 *
 * @Author 马学兴
 * @Create 2024/3/12 0:05
 * @Version 1.0
 * Description:配置地址映射,路由地址转发
 */
@Configuration
public class ImoocMallWebMvcConfig implements WebMvcConfigurer {


    @Value(("${file.upload.dir}"))
    String FILE_UPLOAD_DIR;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**").addResourceLocations(
                "file:"+ FILE_UPLOAD_DIR);
    }
}
